package com.zsh.ssmspringboot1.service.impl;

import com.zsh.ssmspringboot1.mapper.CategoryMapper;
import com.zsh.ssmspringboot1.model.Category;
import com.zsh.ssmspringboot1.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceimpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> selectAll() {
        return categoryMapper.selectAll();
    }

    @Override
    public void add(Map<String, Object> map) {
        categoryMapper.insert(map);
    }

    @Override
    public void delete(Long id) {
        categoryMapper.delete(id);
    }

    @Override
    public void update(Category category) {
        categoryMapper.update(category);
    }

    @Override
    public Category select(Long id) {
        return categoryMapper.select(id);
    }
}
